package com.winai.launcher.bean.db;

import android.text.TextUtils;

import org.litepal.crud.LitePalSupport;

import java.io.Serializable;

public class Device extends LitePalSupport implements Serializable {
    private String deviceName;//设备名称
    /*
     * * deviceId 必须*
     */
    private String deviceId;//设备ID  ***必须***
    private String deviceSNCode = "";//设备SN序列号
    private String userAccount = "";//用户账户
    private String activateAccount = "";//激活账户
    private String deviceType;//设备型号
    private DeviceStatus deviceStatus = DeviceStatus.RUNNING;//设备状态
    private OnlineStatus onlineStatus = OnlineStatus.ONLINE;//在线状态
    private boolean activateStatus;//激活状态
    private boolean bindStatus;//绑定状态
    private String deviceVersion;//固件版本
    private String activateTime;//首次激活时间
    private String recentActivateTime;//最近激活时间
    private String bindTime;//首次绑定时间
    private String recentBindTime;//最近绑定时间
    private String updateTime;//最近更新时间
    private String address = "null";//地区
    private String type = "养生类(写死数据)";//类型，护理类、养生类
    private String deviceChannel = "官网(写死数据)";//设备渠道，官网、实体店、第三方

    /*
     * 说明：运行，待机，无法获取
     */
    public enum DeviceStatus {
        RUNNING, WAITING, UNKNOWN,
    }

    /*
     * 说明：不在线，在线
     */
    public enum OnlineStatus {
        OFF_LINE, ONLINE
    }

    public boolean isValid(){
        return TextUtils.isEmpty(deviceId);
    }

    public String getDeviceName() {
        return deviceName;
    }

    public Device setDeviceName(String deviceName) {
        this.deviceName = deviceName;
        return this;
    }

    public String getDeviceId() {
        return deviceId;
    }

    public Device setDeviceId(String deviceId) {
        this.deviceId = deviceId;
        return this;
    }

    public String getDeviceSNCode() {
        return deviceSNCode;
    }

    public Device setDeviceSNCode(String deviceSNCode) {
        this.deviceSNCode = deviceSNCode;
        return this;
    }

    public String getUserAccount() {
        return userAccount;
    }

    public Device setUserAccount(String userAccount) {
        this.userAccount = userAccount;
        return this;
    }

    public String getActivateAccount() {
        return activateAccount;
    }

    public Device setActivateAccount(String activateAccount) {
        this.activateAccount = activateAccount;
        return this;
    }

    public String getDeviceType() {
        return deviceType;
    }

    public Device setDeviceType(String deviceType) {
        this.deviceType = deviceType;
        return this;
    }

    public DeviceStatus getDeviceStatus() {
        return deviceStatus;
    }

    public Device setDeviceStatus(DeviceStatus deviceStatus) {
        this.deviceStatus = deviceStatus;
        return this;
    }

    public OnlineStatus getOnlineStatus() {
        return onlineStatus;
    }

    public Device setOnlineStatus(OnlineStatus onlineStatus) {
        this.onlineStatus = onlineStatus;
        return this;
    }

    public boolean isActivateStatus() {
        return activateStatus;
    }

    public Device setActivateStatus(boolean activateStatus) {
        this.activateStatus = activateStatus;
        return this;
    }

    public boolean isBindStatus() {
        return bindStatus;
    }

    public Device setBindStatus(boolean bindStatus) {
        this.bindStatus = bindStatus;
        return this;
    }

    public String getDeviceVersion() {
        return deviceVersion;
    }

    public Device setDeviceVersion(String deviceVersion) {
        this.deviceVersion = deviceVersion;
        return this;
    }

    public String getActivateTime() {
        return activateTime;
    }

    public Device setActivateTime(String activateTime) {
        this.activateTime = activateTime;
        return this;
    }

    public String getRecentActivateTime() {
        return recentActivateTime;
    }

    public Device setRecentActivateTime(String recentActivateTime) {
        this.recentActivateTime = recentActivateTime;
        return this;
    }

    public String getBindTime() {
        return bindTime;
    }

    public Device setBindTime(String bindTime) {
        this.bindTime = bindTime;
        return this;
    }

    public String getRecentBindTime() {
        return recentBindTime;
    }

    public Device setRecentBindTime(String recentBindTime) {
        this.recentBindTime = recentBindTime;
        return this;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public Device setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
        return this;
    }

    public String getAddress() {
        return address;
    }

    public Device setAddress(String address) {
        this.address = address;
        return this;
    }

    public String getType() {
        return type;
    }

    public Device setType(String type) {
        this.type = type;
        return this;
    }

    public String getDeviceChannel() {
        return deviceChannel;
    }

    public Device setDeviceChannel(String deviceChannel) {
        this.deviceChannel = deviceChannel;
        return this;
    }
}
